//
//  KQUserHelper.m
//  KangQiaoVHu
//
//  Created by 郭树清 on 16/10/31.
//  Copyright © 2016年 KuoShuChing. All rights reserved.
//

#import "KQUserHelper.h"



@implementation KQUserHelper

// 单例
+ (id)sharedManager{
    static KQUserHelper *handle = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        handle = [[KQUserHelper alloc] init];
    });
    return handle;
}
// 保存信息到本地
//- (void)saveUserInfo:(DELoginModel *)model{
//    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
//    [defaults setObject:model.isLoginSuccess forKey:@"isLoginSuccess"];
//    [defaults setObject:model.userId forKey:@"userId"];
//    [defaults setObject:model.token forKey:@"token"];
//    [defaults setObject:model.mobile forKey:@"mobile"];
//    [defaults setObject:model.tokenId forKey:@"tokenId"];
//    [defaults setObject:model.attestation forKey:@"attestation"];
//    [defaults synchronize];
//}
// 清除用户信息
- (void)clearUserInfo{
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    [defaults setObject:@"0" forKey:@"isLoginSuccess"];
    [defaults setObject:@"" forKey:@"userId"];
    [defaults setObject:@"" forKey:@"token"];
    [defaults setObject:@"" forKey:@"mobile"];
    [defaults setObject:@"" forKey:@"tokenId"];
    [defaults setObject:@"" forKey:@"attestation"];
    [defaults synchronize];
}



@end
